export const sonType = {
  POI: [
    "1",
    "2",
    "3",
    "4",
    "5",
    "6",
    "7",
    "8",
    "9",
    "10",
    "11",
    "12",
    "13",
    "14",
    "15",
    "16",
    "17",
    "18",
    "19",
    "20",
    "21",
    "22",
    "23",
    "99",
  ],
};

export const type = ["POI"];

export const mergeTreeDataByCity = (citites) => {
  let treeData = [];
  for (let i = 0; i < citites.length; i++) {
    let first = {};
    first.title = citites[i];
    first.key = i + "-X-X";
    first.children = [];

    for (let j = 0; j < type.length; j++) {
      let second = {};
      second.title = type[j];
      second.key = i + "-" + j + "-X";
      // second.isLeaf = true;
      second.children = [];

      let nowSonType = sonType[second.title];
      for (let k = 0; k < nowSonType.length; k++) {
        let third = {};
        third.title = "类别" + nowSonType[k];
        third.key = i + "-" + j + "-" + k ;
        third.isLeaf = true;

        second.children.push(third);
      }

      first.children.push(second);
    }
    treeData.push(first);
  }
  return treeData;
};
